home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / mplus_1.exe / MPMENU.H < prev    next >
C/C++ Source or Header  |  1991-12-01  |  4KB  |  91 lines

  1. /*--------------------------------------------------------------
  2.  *  File:           MPMENU.H
  3.  *  Description:    
  4.  *
  5.  *  Developed for the MPLUS Graphic Interface Library
  6.  *  Copyright (c) 1989, 1990 by Michael Yam
  7.  *-------------------------------------------------------------*/
  8.  
  9. #if !defined(_MPTYPES)
  10. typedef short word;
  11. #define _MPTYPES                /* include only once */
  12. #endif
  13.  
  14. /*  Bit masks for menubar attributes.  See MENU_ITEM structure.
  15.  *  Reminder: Intel hardware, most significant bit on the left.
  16.  */
  17. #define MB_SUBMENU      0x80
  18. #define MB_GREYOUT      0x40
  19. #define MB_CHECKMARK    0x02
  20.  
  21. typedef struct _menubar MENUBAR;
  22.  
  23. struct RECTANGLE
  24. {
  25.     word x1, y1, x2, y2;
  26. };
  27.  
  28. struct MENU_INFO
  29. {
  30.     int exitkey;
  31.     int (*exitfun)();
  32.     word fg0, bg0, keycolor0, greyout0;     /* attr for menu bar */
  33.     word border;
  34.     word fg, bg, keycolor, greyout;         /* attr for pull-down menus */
  35. };
  36.  
  37. struct MENU_ITEM
  38. {
  39.     char *title;
  40.     int (*function)();
  41.     struct MENU_ITEM *menu_item;
  42.     int hotkey;                             /* new with v1.4 */
  43.     unsigned submenu:   1;
  44.     unsigned greyout:   1;
  45.     unsigned checkmark: 1;                  /* new with v1.4 */
  46.  
  47.     /* Remaining 5 bits reserved for future use. */
  48. };
  49.  
  50. struct _menubar
  51. {
  52.     word r1, c1, c2;
  53.     word x1, y1, x2, y2;
  54.     char *image;
  55. };
  56.  
  57. /*--------------------------------------------------------------
  58.  *  Function Prototypes
  59.  *--------------------------------------------------------------*/
  60. extern  int mb_open(word r1,word c1,word c2,struct MENU_INFO *menu_info,struct MENU_ITEM *menu_item);
  61. extern  int mb_close(void);
  62. extern  void mb_hide(void);
  63. extern  void mb_show(void);
  64. extern  int (cdecl *mb_run(void))();
  65. extern  int mb_setbits(struct MENU_ITEM *menu_item,unsigned int mask,unsigned int status);
  66.  
  67. extern  int (cdecl *mb_kbinput(struct _menubar *mbptr,int index,struct MENU_INFO *menu_info,struct MENU_ITEM *menu_item))();
  68. extern  int (cdecl *mb_msinput(struct _menubar *mbptr,int index,struct MENU_INFO *menu_info,struct MENU_ITEM *menu_item))();
  69. extern  int mb_altkey(struct MENU_ITEM *menu_item,int ch);
  70. extern  int (cdecl *mb_hotkey(struct MENU_ITEM *menu_item,int ch))();
  71. extern  int mb_intitle(struct _menubar *mbptr,struct MENU_ITEM *menu_item,word x0,word y0);
  72. extern  word mb_highlite(struct _menubar *mbptr,struct MENU_ITEM *menu_item,int index);
  73. extern  void mb_stdcolors(struct MENU_INFO *menu_info);
  74.  
  75. extern  struct _gwdw *mw_open(word r1,word c1,struct MENU_INFO *menu_info,struct MENU_ITEM *menu_item);
  76. extern  int mw_close(struct _gwdw *gwptr);
  77. extern  word mw_getcols(struct MENU_ITEM *menu_item);
  78. extern  word mw_getrows(struct MENU_ITEM *menu_item);
  79. extern  void mw_showtitles(struct MENU_INFO *menu_info,struct MENU_ITEM *menu_item);
  80. extern  void mw_highlite(struct MENU_ITEM *menu_item,word index);
  81. extern  word mw_intitle(struct MENU_ITEM *menu_item,word x0,word y0);
  82. extern  int mw_nexttitle(struct MENU_ITEM *menu_item,int activetitle);
  83. extern  int mw_prevtitle(struct MENU_ITEM *menu_item,int activetitle);
  84. extern  int (cdecl *mw_kbinput(struct MENU_INFO *menu_info,struct MENU_ITEM *menu_item))();
  85. extern  int (cdecl *mw_msinput(struct _menubar *mbptr,struct MENU_INFO *menu_info,struct MENU_ITEM *menu_item))();
  86. extern  struct _gwdw *mw_opensubmenu(struct MENU_INFO *menu_info,struct MENU_ITEM *menu_item,int activetitle);
  87.  
  88. /*--------------------------------------------------------------*
  89.  *                      End of MPMENU.H                         *
  90.  *--------------------------------------------------------------*/
  91.